n = 10;
h = 1/n;
x = linspace(0,1,n+1)';
b = h^2*ones(n-1,1);
d0 = (2+h^2)*ones(n-1,1);
d1 = -ones(n-1,1);
A = spdiags([d1 d0 d1],-1:1,n-1,n-1);
keyboard
u = A\b;
plot(x,[0;u;0],'or')
uteor = 1 - (exp(1)-1)/(exp(2)-1)*exp(x) - (exp(2)-exp(1))/(exp(2)-1)*exp(-x);
errrel1 = norm([0;u;0] - uteor,inf)/norm(uteor,inf)
hold on
keyboard
n = 20;
h = 1/n;
x = linspace(0,1,n+1)';
b = h^2*ones(n-1,1);
d0 = (2+h^2)*ones(n-1,1);
d1 = -ones(n-1,1);
A = spdiags([d1 d0 d1],-1:1,n-1,n-1);
u = A\b;
uteor = 1 - (exp(1)-1)/(exp(2)-1)*exp(x) - (exp(2)-exp(1))/(exp(2)-1)*exp(-x);
plot(x,[0;u;0],'*')
errrel2 = norm([0;u;0] - uteor,inf)/norm(uteor,inf)
hold on


